/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * articulos_sie_invefisico_repdiferencia.java
 *
 * Created on 28/04/2011, 11:38:09 AM
 */

package sie_invdis;

import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;

import java.text.ParseException;
import java.text.*;
/**
 *
 * @author Michelle
 */
public class articulos_sie_invefisico_repdiferencia extends javax.swing.JFrame {

     private javax.swing.table.DefaultTableModel jtable_modelo;
     private javax.swing.table.DefaultTableModel jtable_modelo_subfam;
     private javax.swing.table.DefaultTableModel jtable_modelo_subfamhis;

     bd_conexion x = new bd_conexion();
      ResultSet rs = null;
      int fidtienda=0, fidinve=0;
       private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
    private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
    /** Creates new form articulos_sie_invefisico_repdiferencia */
    public articulos_sie_invefisico_repdiferencia() {
        initComponents();
    }
     public articulos_sie_invefisico_repdiferencia(int idtienda,int idinve) {
        this.iniciar_modelo_de_tabla();
        this.iniciar_modelo_subfam();
        this.iniciar_modelo_subfamhisto();
        initComponents();
        fidtienda=idtienda;
        fidinve=idinve;
        jtb_catalogo_articulos.getColumnModel().getColumn(0).setPreferredWidth(60);//tem ent
        jtb_catalogo_articulos.getColumnModel().getColumn(1).setPreferredWidth(60);//familia
        jtb_catalogo_articulos.getColumnModel().getColumn(2).setPreferredWidth(60);//subfam.

        jtb_catalogo_articulos.getColumnModel().getColumn(3).setPreferredWidth(15);//id
        jtb_catalogo_articulos.getColumnModel().getColumn(4).setPreferredWidth(45);//clave
        jtb_catalogo_articulos.getColumnModel().getColumn(5).setPreferredWidth(80);//descrip.
        jtb_catalogo_articulos.getColumnModel().getColumn(6).setPreferredWidth(45);//item
        jtb_catalogo_articulos.getColumnModel().getColumn(7).setPreferredWidth(25);//precio
        jtb_catalogo_articulos.getColumnModel().getColumn(8).setPreferredWidth(25);//f.ult. compra
        jtb_catalogo_articulos.getColumnModel().getColumn(9).setPreferredWidth(25);//Observaciones

        jtb_catalogo_articulos.getTableHeader().setBackground(Color.yellow);
        //this.carga_datos_reportediferencias(idtienda,idinve,0,"");

        jt_repsubfamh.getColumnModel().getColumn(0).setPreferredWidth(30);//tem ent
        jt_repsubfamh.getColumnModel().getColumn(1).setPreferredWidth(120);//familia
        jt_repsubfamh.getColumnModel().getColumn(2).setPreferredWidth(60);//subfam.
        jt_repsubfamh.getColumnModel().getColumn(3).setPreferredWidth(60);//id
        jt_repsubfamh.getColumnModel().getColumn(4).setPreferredWidth(60);//clave
        jt_repsubfamh.getColumnModel().getColumn(5).setPreferredWidth(60);//descrip.
        jt_repsubfamh.getColumnModel().getColumn(6).setPreferredWidth(60);//descrip.
        jt_repsubfamh.getTableHeader().setBackground(Color.yellow);



        jt_repsubfamhistorial.getColumnModel().getColumn(0).setPreferredWidth(30);//tem ent
        jt_repsubfamhistorial.getColumnModel().getColumn(1).setPreferredWidth(120);//familia
        jt_repsubfamhistorial.getColumnModel().getColumn(2).setPreferredWidth(60);//subfam.
        jt_repsubfamhistorial.getColumnModel().getColumn(3).setPreferredWidth(60);//id
        jt_repsubfamhistorial.getColumnModel().getColumn(4).setPreferredWidth(60);//clave
        jt_repsubfamhistorial.getColumnModel().getColumn(5).setPreferredWidth(60);//descrip.
        jt_repsubfamhistorial.getColumnModel().getColumn(6).setPreferredWidth(60);//descrip.
        jt_repsubfamhistorial.getColumnModel().getColumn(7).setPreferredWidth(60);//descrip.
        jt_repsubfamhistorial.getTableHeader().setBackground(Color.yellow);

        this.carga_datos_reportedifxsub(idtienda,idinve);
        this.setLocation(5,5);
    }

    private void iniciar_modelo_de_tabla()
    {

        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><b>Temp. Ent.</b></html>");
        jtable_modelo.addColumn("<html><b>Familia</b></html>");
        jtable_modelo.addColumn("<html><b>Sub_fam.</b></html>");
        jtable_modelo.addColumn("<html><b>Id</b></html>");
        jtable_modelo.addColumn("<html><b>Clave</b></html>");
        jtable_modelo.addColumn("<html><b>Descripcion.</b></html>");
        jtable_modelo.addColumn("<html><b>Item.</b></html>");
        jtable_modelo.addColumn("<html><b>Costo</b></html>");
        jtable_modelo.addColumn("<html><b>Precio</b></html>");
        jtable_modelo.addColumn("<html><b>Teorica</b></html>");
        jtable_modelo.addColumn("<html><b>Fisica</b></html>");
        jtable_modelo.addColumn("<html><b>Diferencia</b></html>");

    }
   private void iniciar_modelo_subfam()
    {

        jtable_modelo_subfam=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_subfam.addColumn("<html><b>id</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>sub Familia</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>teorica.</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>fisica</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>dif</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>costo Fis</b></html>");
        jtable_modelo_subfam.addColumn("<html><b>costo dif.</b></html>");

    }
private void iniciar_modelo_subfamhisto()
    {

        jtable_modelo_subfamhis=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_subfamhis.addColumn("<html><b>id</b></html>");
        jtable_modelo_subfamhis.addColumn("<html><b>sub Familia</b></html>");
        jtable_modelo_subfamhis.addColumn("<html><b>teorica.</b></html>");
        jtable_modelo_subfamhis.addColumn("<html><b>fisica</b></html>");
        jtable_modelo_subfamhis.addColumn("<html><b>dif</b></html>");
        jtable_modelo_subfamhis.addColumn("<html><b>costo Fis</b></html>");
        jtable_modelo_subfamhis.addColumn("<html><b>costo dif.</b></html>");
        jtable_modelo_subfamhis.addColumn("<html><b>Fecha</b></html>");

    }
   private void diodblclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
            System.out.println("dio doble  click");
            int fila = jt_repsubfamh.getSelectedRow();
            String idcadena=this.jt_repsubfamh.getValueAt(fila, 0).toString();

            this.carga_datos_reportediferencias(fidtienda,fidinve,2,idcadena);
            this.carga_datos_reportedifxsubhis("1", String.valueOf(fidtienda), idcadena);
               //this.carga_datos_detalleinve(ftienda, ffoliopadre,1,idcadena);
    }

   private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");

         int fila = jtb_catalogo_articulos.getSelectedRow();
         Object valor = jtb_catalogo_articulos.getValueAt(fila, 3);


        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        articulos_sie_editar fase=new articulos_sie_editar(valor.toString());
        fase.pack();
        fase.setVisible(true);

        //setVisible(false);
    }

  private void carga_datos_reportediferencias(int idtienda,int idfoliopadre,int opcion,String textbusqueda)
    {

         DecimalFormat miformat = new DecimalFormat("###,###,###,###");
        String htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="";
       //invoco al metodo que trae el recordset de datos
       while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
       //voy por el detalle del documento
       float colexis=0;
       Object[] fnewRow = new Object[12];
       String texto="select * from x1sieuno_articulo_inven_congelar_reportdiferencias("+idtienda+","+idfoliopadre+","+opcion+",'"+textbusqueda+"') as (iddet integer,idfisico integer,clave character varying(16),cantteo numeric,cantfis numeric,observa text,costo numeric,precio numeric,impcostofis numeric,importpreciofis numeric,importcosteo numeric,importprecioteo numeric,cantdif numeric,costodif numeric,preciodif numeric,descripcion character varying(80),familia integer,subfam integer,fechaulti date,tementrada character varying(25),item character varying(80),precio1 numeric,nombrefamilia character varying(30),nombresubfamilia character varying(50),idproducto integer);";
       System.out.println(texto);
        try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("tementrada");
                        fnewRow[1]=rs.getString("nombrefamilia");
                        fnewRow[2]=rs.getString("nombresubfamilia");
                        fnewRow[3]=rs.getString("idproducto");
                        fnewRow[4]=rs.getString("clave");
                        fnewRow[5]=rs.getString("descripcion");
                        fnewRow[6]=rs.getString("item");
                        fnewRow[7]=rs.getString("costo");
                        fnewRow[8]=rs.getString("precio");
                        fnewRow[9]=rs.getString("cantteo");
                        fnewRow[10]=rs.getString("cantfis");
                        colexis=rs.getFloat("cantdif");
                        colorabre="";
                        colorcierra="";
                        if (colexis<0)
                                {
                                    colorabre="<b><font color=#CC0000>";
                                    colorcierra="<font></b>";
                                }
                        if (colexis>0)
                                {
                                    colorabre="<b><font color=\"YELLOW\">";
                                    colorcierra="<font></b>";
                                }
                        fnewRow[11]=htmlabre+colorabre+rs.getFloat("cantdif")+colorcierra+htmlcierra;
                        jtable_modelo.addRow(fnewRow);
              }
        }
        catch(Exception e)
         {
            System.out.println(e.getMessage());
        }


      }

private void carga_datos_reportedifxsub(int idtienda,int idfoliopadre)
    {

         DecimalFormat miformat = new DecimalFormat("###,###,###,###");

       //invoco al metodo que trae el recordset de datos
        while(jtable_modelo_subfam.getRowCount()>0)jtable_modelo_subfam.removeRow(0);
       //voy por el detalle del documento
       Object[] fnewRow = new Object[7];

        try
         {
            rs = x.sieuno_executediversosv2("select * from x1sieuno_articulo_inven_congelar_reportdifxsubfam("+idtienda+","+idfoliopadre+") as (idpadre integer,subfam integer,nombresubfam character varying(50),cantteo numeric,cantfis numeric,importecosfis numeric,importeprefis numeric,importecosteo numeric,importepreteo numeric,cantidaddif numeric,costodif numeric,preciodif numeric);",variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("subfam");
                        fnewRow[1]=rs.getString("nombresubfam");
                        fnewRow[2]=miformat.format(rs.getFloat("cantteo"));
                        fnewRow[3]=miformat.format(rs.getFloat("cantfis"));
                        fnewRow[4]=miformat.format(rs.getFloat("cantidaddif"));
                        fnewRow[5]=miformat.format(rs.getFloat("importecosfis"));
                        fnewRow[6]=miformat.format(rs.getFloat("costodif"));
                        jtable_modelo_subfam.addRow(fnewRow);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }


      }
private void carga_datos_reportedifxsubhis(String opcion, String idtienda,String textobusca)
    {

         DecimalFormat miformat = new DecimalFormat("###,###,###,###");

       //invoco al metodo que trae el recordset de datos
       while(jtable_modelo_subfamhis.getRowCount()>0)jtable_modelo_subfamhis.removeRow(0);
       //voy por el detalle del documento
       Object[] fnewRow = new Object[8];

        try
         {
            rs = x.sieuno_executediversosv2("select * from x1sieuno_articulo_inven_congelar_reportdifxsubhisto("+opcion+","+idtienda+",'"+textobusca+"') as (idpadre integer,subfam integer,nombresubfam character varying(50),cantteo numeric,cantfis numeric,importecosfis numeric,importeprefis numeric,importecosteo numeric,importepreteo numeric,cantidaddif numeric,costodif numeric,preciodif numeric,fechaaplico date);",variables_global.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("subfam");
                        fnewRow[1]=rs.getString("nombresubfam");
                        fnewRow[2]=miformat.format(rs.getFloat("cantteo"));
                        fnewRow[3]=miformat.format(rs.getFloat("cantfis"));
                        fnewRow[4]=miformat.format(rs.getFloat("cantidaddif"));
                        fnewRow[5]=miformat.format(rs.getFloat("importecosfis"));
                        fnewRow[6]=miformat.format(rs.getFloat("costodif"));
                        fnewRow[7]=this.fechaeuropea(rs.getString("fechaaplico"));
                        jtable_modelo_subfamhis.addRow(fnewRow);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
}


     private String  fechaeuropea(String fecha) {
         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtb_catalogo_articulos = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jt_repsubfamh = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel3 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jt_repsubfamhistorial = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jmni_actualizar = new javax.swing.JMenuItem();
        jmni_escape = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(articulos_sie_invefisico_repdiferencia.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jtb_catalogo_articulos.setModel(this.jtable_modelo);
        jtb_catalogo_articulos.setName("jtb_catalogo_articulos"); // NOI18N
        jtb_catalogo_articulos.setRowHeight(26);
        jtb_catalogo_articulos.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jtb_catalogo_articulosMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    dioclick(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane1.setViewportView(jtb_catalogo_articulos);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 905, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jt_repsubfamh.setModel(this.jtable_modelo_subfam);
        jt_repsubfamh.setName("jt_repsubfamh"); // NOI18N
        jt_repsubfamh.setRowHeight(26);
        jt_repsubfamh.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_repsubfamMouseClicked(evt);
                if(evt.getClickCount() >= 2)
                {
                    diodblclick(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane2.setViewportView(jt_repsubfamh);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 472, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE)
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jt_repsubfamhistorial.setModel(this.jtable_modelo_subfamhis);
        jt_repsubfamhistorial.setName("jt_repsubfamhistorial"); // NOI18N
        jt_repsubfamhistorial.setRowHeight(26);
        jScrollPane3.setViewportView(jt_repsubfamhistorial);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 494, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE)
        );

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jmni_actualizar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5, 0));
        jmni_actualizar.setIcon(resourceMap.getIcon("jmni_actualizar.icon")); // NOI18N
        jmni_actualizar.setText(resourceMap.getString("jmni_actualizar.text")); // NOI18N
        jmni_actualizar.setName("jmni_actualizar"); // NOI18N
        jmni_actualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_actualizarActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_actualizar);

        jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
        jmni_escape.setName("jmni_escape"); // NOI18N
        jmni_escape.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_escapeActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_escape);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(82, 82, 82))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
               if(JOptionPane.showConfirmDialog(null, "Realmente Desea Salir?")==0)
                    {
                        this.dispose();
                    }
        
}//GEN-LAST:event_jmni_salirActionPerformed

    private void jmni_actualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_actualizarActionPerformed
        // TODO add your handling code here:
         this.carga_datos_reportediferencias(fidtienda,fidinve,0,"");
    }//GEN-LAST:event_jmni_actualizarActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed


private void jt_repsubfamMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }

 
 private void jtb_catalogo_articulosMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                //articulos_sie_invefisico_repdiferencia dialog = new articulos_sie_invefisico_repdiferencia(new javax.swing.JFrame(), true);
                articulos_sie_invefisico_repdiferencia dialog = new articulos_sie_invefisico_repdiferencia();
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JMenuItem jmni_actualizar;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JTable jt_repsubfamh;
    private javax.swing.JTable jt_repsubfamhistorial;
    private javax.swing.JTable jtb_catalogo_articulos;
    // End of variables declaration//GEN-END:variables

}
